package com.taylor.spring5.aop;


import org.junit.jupiter.api.Test;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

/**
 * @author taylor
 * @Description: TODO
 * @date 2021/4/5 0:04
 */
public class TestAop {

    /**
     * 测试aop
     */
    @Test
    public void testAop(){
        //xml方式测试
/*        ClassPathXmlApplicationContext applicationContext = new ClassPathXmlApplicationContext("aopbean.xml");
        com.taylor.spring5.aop.User user = applicationContext.getBean("user", com.taylor.spring5.aop.User.class);
        user.add();*/

        //java类配置文件方式

        AnnotationConfigApplicationContext applicationContext = new AnnotationConfigApplicationContext(ConfigAop.class);
        User user = applicationContext.getBean("user",User.class);
        user.add();

    }
}
